using UnityEngine;
using System.Collections;

public class AtlasPersonagem : MonoBehaviour 
{
    public static Texture2D globalTexture;
    public static Rect[] rects;
    private Texture2D[] textures;

    public static Material globalMaterial;

    void Awake()
    {
        textures = new Texture2D[8];
		
		this.textures[0] = ((Texture2D)Resources.Load("Textures/Personagem/Personagem-1"));
		this.textures[1] = ((Texture2D)Resources.Load("Textures/Personagem/Personagem-2"));
		this.textures[2] = ((Texture2D)Resources.Load("Textures/Personagem/Personagem-3"));
		this.textures[3] = ((Texture2D)Resources.Load("Textures/Personagem/PersonagemPulo-1"));
		this.textures[4] = ((Texture2D)Resources.Load("Textures/Personagem/PersonagemPulo-2"));
		this.textures[5] = ((Texture2D)Resources.Load("Textures/Personagem/PersonagemPulo-3"));
		this.textures[6] = ((Texture2D)Resources.Load("Textures/Personagem/PersonagemPulo-4"));
		this.textures[7] = ((Texture2D)Resources.Load("Textures/Personagem/PersonagemPulo-5"));

        globalTexture = AtlasTexture.Create(this.textures, out rects);

        globalMaterial = new Material((Shader)Resources.Load("Shader/Basic2D"));
        globalMaterial.mainTexture = globalTexture;
    }
}
